//
//  Soldier.m
//  Legions
//
//  Created by Legions on 02/07/14.
//  Copyright (c) 2014 RefeSoft. All rights reserved.
//

#import "Soldier.h"

@implementation Soldier

//this is a global variable
float SOLDIER_SIZE = 25;

-(instancetype) initWithParentNode : (SKNode*) worldNode position : (CGPoint) position{
    
    self = [Soldier spriteNodeWithImageNamed:@"Spaceship"];
    
    if(self){
        [self setSize:CGSizeMake(SOLDIER_SIZE,SOLDIER_SIZE)];
        [worldNode addChild:self];

        self.physicsBody    = [SKPhysicsBody bodyWithCircleOfRadius:SOLDIER_SIZE*0.5];
        
        self.position       = position;
        
        self.alpha          = 1;
    }
    
    return self;
}



- (void) moveTo:(CGPoint)destination duration:(NSTimeInterval)sec{
    [self runAction:[SKAction moveTo:destination duration:sec]];
}



@end
